<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="head.inc" %>

	<%@ include file="ueditor.inc" %>
</head>
<body>
<div width="100%">
	<div>+${modelName}+</div>
	<div width="100%">


		<form method="post" action="/admin/${modelName}/update/${id}">
			<input type="hidden" name="cur.id" value="${id}"/>
			<table border="1" width="100%">
				<tr><td width="20px;">字段</td><td>值</td></tr>
				<tr><td>操作</td><td><input type="submit" value="提交"/><input type="reset" value="重置"/></td></tr>
			<c:forEach var="item" items="${fields}">
				<%--<c:set var="fieldName" value="${item.name()}" />--%>
				<tr><td>${item}</td>
					<td>
						<c:choose>
							<c:when test="${item=='id'}">
								<c:if test="${empty cur.id}">新增</c:if>
								<c:if test="${cur.id!=0}">${cur.id}</c:if>
							</c:when>
							<c:when test="${item=='addTime'||item=='upTime'}">
								<c:if test="${empty cur[item]}">空</c:if>
								<c:if test="${!empty cur[item]}"><m:content value="${cur[item]}"/></c:if>
							</c:when>
							<c:when test="${item=='content'}">
								<script type="text/plain" id="myEditor" name="content">${cur[item]}</script>
								<script type="text/javascript">
									var editor = new baidu.editor.ui.Editor({
										//initialContent: '<span style="color:#ccc"><m:content value="${cur.content}"/></span>'
									});
									editor.render("myEditor");
								</script>
							</c:when>
							<c:otherwise>
								<c:if test="${!empty cur[item]}">原值：${cur[item]}</c:if><br/>
								<input type="text" value="${cur[item]}" name="${item}"/>
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
			</c:forEach>
				<tr><td>操作</td><td><input type="submit" value="提交"/><input type="reset" value="重置"/></td></tr>
			</table>
		</form>
	</div>
</div>
<%@ include file="foot.inc" %>